<?php 
if(isset($_GET['i'])){
	$id = get("i");
	$sql="SELECT * FROM `empresas`,`imagens_empresa` WHERE `empresas`.`id_empresa` LIKE `imagens_empresa`.`empresa_id` AND `empresas`.`id_empresa` LIKE '$id' AND `imagens_empresa`.`foto_pos` LIKE '0'";
	$result = mysql_query($sql);
	$row = mysql_fetch_array($result);
	$nome_empresa = $row['nome_empresa'];
	$endereco = $row['endereco'];
	$fone = $row['telefone'];
	$email = $row['email'];
	$foto_url = $row['foto_url'];
	
}
else
	header("Location: index.php?pg=home");
?>
	<script language="javascript" type="text/javascript" src="valida_contato.js"></script>

    <!-- Page Content -->
    <div class="container">     
        <!-- /.row -->
		<div class="" align="">
				<h3><?php echo $nome_empresa; ?></h3>
			</div>
        <!-- Content Row -->
        <div class="row">
	        
            <!-- Map Column -->
            <div class="span6">
                <!-- Embedded Google Map -->
                <iframe width="100%" height="400px" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?hl=en&amp;ie=UTF8&amp;ll=-19.00269901,-57.64472187&amp;spn=56.506174,79.013672&amp;t=m&amp;z=15&amp;output=embed"></iframe>
            </div>
            <!-- Contact Details Column -->
            <div class="span2">
                <h3>Detalhes</h3>
                <p >
                    <?php echo $endereco; ?>
                </p>
                <p style="font-size: 11px"><i class="fa fa-phone"></i> 
                    <abbr title="Phone">T</abbr>:<?php echo $fone; ?></p>
                <p style="font-size: 11px"><i class="fa fa-envelope-o"></i> 
                    <abbr title="Email">E</abbr>: <a href="<?php echo $email; ?>"><?php echo $email; ?></a>
                </p>
                <p style="font-size: 11px"><i class="fa fa-clock-o"></i> 
                    <abbr title="Hours">H</abbr>: Segunda - Sexta-feira: 7:00 AM to 5:00 PM</p>
                
                    	<a href="#"><i class="fa fa-facebook-square fa-2x"></i></a>
                        <a href="#"><i class="fa fa-linkedin-square fa-2x"></i></a>
                        <a href="#"><i class="fa fa-twitter-square fa-2x"></i></a>
                        <a href="#"><i class="fa fa-google-plus-square fa-2x"></i></a>
                <br>    
                <div>
                	<a href="admin/<?php echo $foto_url;?>" data-lightbox="holanda"><img style="width: 200px; height: 100px" src="admin/<?php echo $foto_url;?>"></a>
                	<br><br>
                	<?php 
                		$sql_2 = "SELECT * FROM `imagens_empresa` WHERE `imagens_empresa`.`empresa_id` LIKE $id AND `imagens_empresa`.`foto_pos` <> '0'";
                		$result_2 = mysql_query($sql_2);
                		while($row_2 = mysql_fetch_array($result_2)){
							$foto_url_2 = $row_2['foto_url'];
                	?>
                			<a href="admin/<?php echo $foto_url_2;?>" data-lightbox="holanda"><img style="width: 50px; height: 25px" src="admin/<?php echo $foto_url_2;?>"></a>
                	
                	<?php }?>
                </div>
            </div>
        </div>
        <!-- /.row -->

        <!-- Contact Form -->
        <!-- In order to set the email address and subject line for the contact form go to the bin/contact_me.php file. -->
        <div class="row">
            <div class="span6">
                <h3>Envie-nos uma Mensagem</h3>
                <form name="form1" id="contactForm" novalidate method="post" action ="enviarEmail.php">
                    <div class="control-group form-group">
                        <div class="controls">
                            <label>Nome:</label>
                            <input type="text" class="span6" id="nome" name="nome" required data-validation-required-message="Seu Nome">
                            <p class="help-block"></p>
                        </div>
                    </div>
                    <div class="control-group form-group">
                        <div class="controls">
                            <label>Telefone para contato:</label>
                            <input type="text" class="span6" id="phone" name="phone" maxlength="14" required data-validation-required-message="Informe o numero de seu telefone." onkeypress="MascaraTelefone(form1.phone);">
                        </div>
                    </div>
                    <div class="control-group form-group">
                        <div class="controls">
                            <label>Email:</label>
                            <input type="email" class="span6" id="email" name="email" required data-validation-required-message="Informe seu email.">
                        </div>
                    </div>
                    <div class="control-group form-group">
                        <div class="controls">
                            <label>Mensagem:</label>
                            <textarea rows="10" cols="100" class="span6" id="message" name="message" required data-validation-required-message="Sua Mensagem" maxlength="999" style="resize:none"></textarea>
                        <input type="hidden" value="<?php echo $email; ?>" name="email_empresa" id="email_empresa">
                        </div>
                    </div>
                    <div id="success"></div>
                    <!-- For success/fail messages -->
                 
                    <input type="submit" value="Enviar" class="btn btn-info pull-right" name="Enviar" onclick="return valida()" >
                </form>
            </div>

        </div>
       </div>
        <!-- /.row -->

       